Repository navigation
[PR] gate: fix upstream recorder leak causing real model gate deadlock (pipe inheritance) | gate: 修上游 recorder 泄漏导致真模型门禁卡死(管道继承) - #6671
Merged
Conversation
The recorder was spawned with stdio ['ignore','ignore','inherit'] and detached:true. When a lane aborted before its own teardown, the detached recorder kept the inherited stderr open — which, in the entrypoint's '| tee lane.log' pipeline, is the very pipe the entrypoint waits on. The whole gate then sat in do_wait until someone killed the recorder (observed 2026-11-14: master candidate run wedged 3h after the restart lanes; I/X never ran). - stderr goes to a per-lane recorder.stderr.log instead of the lane's inherited log pipe (a leaked recorder is now harmless). - main()'s per-agent catch SIGKILLs the in-flight recorder so aborted lanes do not leave orphans behind.
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9907-pr.6671.657e470This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6671.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1194-master.9495c76 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现象
真模型 gate 跑 master 候选时,restart-lanes 段结束后整个 gate 卡死 3 小时:entrypoint 停在 do_wait 里等
| tee restart-lanes.log的 EOF,而 EOF 永远不会来——Lane I/X 根本没机会跑(2026-11-14 实测,手动 kill 容器里的 recorder 进程后立即恢复)。根因
scripts/gate/plugin-lanes.mjs里 upstream recorder 以stdio: ["ignore","ignore","inherit"] + detached: true启动。stderr "inherit" 拿到的正是 entrypoint 那条2>&1 | tee lane.log管道的写端。当某条 lane 在自身 teardown 之前异常中止,detach 出去的 recorder 还活着、还握着这根管道 → tee 永远收不到 EOF → entrypoint 永远卡在 wait。修复(scripts/gate/plugin-lanes.mjs,2 处)
recorder.stderr.log(fs.openSync(..., "a"))——泄漏的 recorder 从此无害,这是根因修复;activeRec跟踪)——lane 中止不再留孤儿进程。验证:
node --check通过;gate 侧镜像内副本(restart-lanes.mjs / plugin-lanes.mjs)已同步同样修改并在真机跑通完整 plugin+restart 段。